package xian.woniuxy.mapper.custom;

import org.apache.ibatis.annotations.Param;
import xian.woniuxy.entity.Role;
import xian.woniuxy.mapper.RoleMapper;

import java.util.List;

/**
 * @author gao
 * @date 2023/07/04 11:53:33
 */
public interface CustomRoleMapper extends RoleMapper {
    Role findOneWithPermissions(Integer roleId);

    int clearRolePermissions(Integer roleId);

    int distributePermissions(@Param("rid") Integer rid, @Param("permissionIds") List<Integer> permissionIds);

    List<Integer> findRoleIdsByUserId(Integer userId);
}
